// Author: wsfuyibing <682805@qq.com>
// Date: 2025-06-30

package ticket

import (
	"server/app/http/models"
	"server/app/http/responses"
)

// Response
// 出参.
type Response struct {
	Arcade   *responses.ArcadeResponse          `json:",omitempty"`
	Ticket   *responses.TicketResponse          `json:",omitempty"`
	Sessions []*responses.TicketSessionResponse `json:"Sessions,omitempty"`
}

// NewResponse
// 创建出参.
func NewResponse() *Response {
	return &Response{
		Sessions: make([]*responses.TicketSessionResponse, 0),
	}
}

// AddSession
// 添加场次.
func (o *Response) AddSession(m *models.TicketSession) {
	o.Sessions = append(o.Sessions,
		(&responses.TicketSessionResponse{}).With(m),
	)
}

// WithArcade
// 绑定钓场.
func (o *Response) WithArcade(m *models.Arcades) {
	o.Arcade = (&responses.ArcadeResponse{}).With(m)
}

// WithTicket
// 绑定渔票.
func (o *Response) WithTicket(m *models.Ticket) {
	o.Ticket = (&responses.TicketResponse{}).With(m)
}
